//
//  JQGeTuiService.h
//  JQGeTuiService
//
//  Created by JQZ on 2018/1/18.
//  Copyright © 2018年 JQ. All rights reserved.
//

#import <GTSDK/GeTuiSdk.h>
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
#import <UserNotifications/UserNotifications.h>
#endif
#import <JQSOAppDelegate/JQSOAppDelegate.h>

/**
 *  @brief 用于[NSUserDefaults standardUserDefaults]持久化和NSNotificationCenter传送数据
 */
extern NSString *const JQNotificationsDeviceToken;
extern NSString *const JQNotificationsClientId;
extern NSString *const JQNotificationsGeTuiNotification;
extern NSString *const JQNotificationsRemoteNotification;

/**
 *  @brief  回调通知协议
 */
extern NSString *const JQGeTuiServiceNotifyReceiveDeviceToken;
extern NSString *const JQGeTuiServiceNotifyReceiveGeTuiClientId;
extern NSString *const JQGeTuiServiceNotifyReceiveGeTuiNotification;
extern NSString *const JQGeTuiServiceNotifyReceiveRemoteNotification;

/**
 *  @brief  回调协议
 */
@protocol JQGeTuiServiceDelegate<NSObject>

@optional
/**
 *  @brief 获得注册成功时的deviceToken 可以在里面做一些绑定操作
 */
- (void)GeTuiServiceDidReceiveDeviceToken:(NSString *)deviceToken;

/**
 *  @brief 获得个推注册成功时的clientId
 */
- (void)GeTuiServiceDidReceiveGeTuiClientId:(NSString *)clientId;

/**
 *  @brief  处理个推消息
 */
- (void)GeTuiServiceDidReceiveGeTuiNotification:(NSDictionary *)notification;

/**
 *  @brief  处理远程苹果通知
 */
- (void)GeTuiServiceDidReceiveRemoteNotification:(NSDictionary *)notification;

@end

/**
 *  @brief  个推服务
 */
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0
@interface JQGeTuiService : NSObject<JQAppService,GeTuiSdkDelegate,UNUserNotificationCenterDelegate>
#else
@interface JQGeTuiService : NSObject<JQAppService,GeTuiSdkDelegate>
#endif

// 个推配置
@property (strong, nonatomic) NSString *gtAppId;
@property (strong, nonatomic) NSString *gtAppKey;
@property (strong, nonatomic) NSString *gtAppSecret;
@property (strong, nonatomic) NSString *gtChannelId;

// 回调协议
@property (nonatomic, weak) id<JQGeTuiServiceDelegate>delegate;

@end
